package netInterfaces;

import java.io.Serializable;
import java.text.*;
import java.util.*;

public class Message implements Serializable{
	
	private int messageID;
	private String messageAuthor;
	private String messageTheme;
	private String messageText;
	private String messageDate;
	private String messageTime;
	private SimpleDateFormat dateFormat, timeFormat;
	private Date date;
	
	public Message(){
		messageID = 0;
		messageTheme = "";
		messageText = "";
		messageAuthor = "";
		date = new Date();
		setMessageDate();
		setMessageTime();
	}

	public int getMessageID() {
		return messageID;
	}
	
	public String getMessageAuthor(){
		return messageAuthor;
	}

	public String getMessageTheme() {
		return messageTheme;
	}

	public String getMessageText() {
		return messageText;
	}

	public String getMessageDate() {
		return messageDate;
	}

	public String getMessageTime() {
		return messageTime;
	}

	public void setMessageID(int messageID) {
		this.messageID = messageID;
	}
	
	public void setMessageAuthor(String author){
		this.messageAuthor = author;
	}

	public void setMessageTheme(String messageTheme) {
		this.messageTheme = messageTheme;
	}

	public void setMessageText(String messageText) {
		this.messageText = messageText;
	}

	public void setMessageDate() {
		dateFormat = new SimpleDateFormat("dd.MM.yy");
		this.messageDate = dateFormat.format(date).toString();
	}

	public void setMessageTime() {
		timeFormat = new SimpleDateFormat("HH:mm:ss");
		this.messageTime = timeFormat.format(date).toString();
	}
	
	

}
